import {   device_status } from '@/plugins/mate.js'
let status = {
    '': '全部',
    0: '停机',
    1: '正常',
    2: '告警',
    3: '离线',
}
let status_options = device_status.options
let colorList = device_status.color
export const colors = colorList
export const config = [
    {
        name: 'device_name',
        type: 'input',
        placeholder: '设备名称',
    },
    {
        name: 'scope_id_list',
        type: 'cascader',
        placeholder: '筛选范围',
        options: [],
    },

    {
        name: 'type_id',
        type: 'select_id',
        placeholder: '设备类型',
        options: [],
    },
    {
        name: 'status',
        type: 'select',
        placeholder: '设备状态',
        options: status_options,
    },
]
export const cloum = [
    // {
    //     label: '工厂',
    //     name: 'factory_name',
    // },
    {
        label: '区域',
        name: 'zone_name',
    },
    // {
    //     label: '设备名',
    //     name: 'device_name',
    // },
    {
        label: '类型',
        name: 'type_name',
    },
    {
        label: '测点数',
        name: 'sensor_count',
    },
    {
        label: '告警数',
        name: 'warn_count',
    },
    {
        label: '设备状态',
        name: 'status',
        format: (val) => status[val],
        color: (val) => colorList[val],
    },
]
